<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width,user-scalable=no"name="viewport">
<title>交易明细</title>
<link rel="stylesheet" type="text/css" href="<?php echo C('WEB_URL');?>Public/business/style/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo C('WEB_URL');?>Public/business/style/base.css" />
<link rel="stylesheet" type="text/css" href="<?php echo C('WEB_URL');?>Public/business/style/style.css" />
<link rel="stylesheet" type="text/css" href="<?php echo C('WEB_URL');?>Public/business/style/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="<?php echo C('WEB_URL');?>Public/business/style/mui.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo C('WEB_URL');?>Public/business/style/app.css" />
<script type="text/javascript" charset="UTF-8" src="<?php echo C('WEB_URL');?>Public/business/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo C('WEB_URL');?>Public/business/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo C('WEB_URL');?>Public/business/js/script.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo C('WEB_URL');?>Public/business/js/mui.min.js"></script>
<style>
.mui-content #pullrefresh{width:100%;max-width:640px;margin:50px auto;}
</style>
</head>
<body>
<div id="box">
 <div class="navbar navbar-default navbar-fixed-top">
  <header>
   <h1><a href="index.html"><span class="glyphicon glyphicon-menu-left"></span></a></h1>
   <p class="title">交易明细</p>
  <!--  <p class="title"><input type="text" placeholder="搜索会员账号/昵称" class="dealSeek"></p>
   <h6><img src="<?php echo C('WEB_URL');?>Public/business/images/manage_03.jpg" /></h6> -->
  </header>
 </div><!--navbar-fixed-top-->
  <div class="mui-content">
  	<div id="slider" class="mui-slider mui-fullscreen" style="width:100%;max-width:640px;margin:0 auto">
 <!--下拉刷新容器-->
 <div id="pullrefresh" class="mui-content mui-scroll-wrapper">
  <div class="mui-scroll details">
   <h4>累计交易次数：<?php echo ($list1); ?>次</h4>
   <!--数据列表-->
   <ul class="mui-table-view mui-table-view-chevron" id="contentop">
	<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li class="action">
	  <div class="detail">
       <p><?php echo ($vo["time"]); ?></p>
       <div class="detLeft">
   	    <img src="<?php echo C('WEB_URL');?>Public/business/images/member_03.jpg" />
       </div><!--detLeft-->
       <div class="detCenter">
       	 <p>NO.<?php echo ($vo["id"]); ?></p>
   	    <p class="detName"><?php echo ($vo["name"]); ?></p>
   	    <p>使用优惠卡	</p>
   	   
       </div><!--detCenter-->
       <div class="detRight">
       </div><!--detRight-->
      </div><!--detail-->
     </li><?php endforeach; endif; else: echo "" ;endif; ?>
   </ul>
  </div><!--mui-scroll-->
 </div><!-- pullrefresh-->

 <?php if($list2["purview"] == 0): ?><div class="navbar navbar-default navbar-fixed-bottom">	
   <footer>
    <dl>
     <dt><a href="index.html"><img src="<?php echo C('WEB_URL');?>Public/business/images/home.png" /></a></dt>
     <dd><a href="index.html" class="current">首页</a></dd>
    </dl>
    <dl>
     <dt><a href="pullrefresh_sub.html"><img src="<?php echo C('WEB_URL');?>Public/business/images/deal_07.jpg" /></a></dt>
     <dd><a href="pullrefresh_sub.html">员工管理</a></dd>
    </dl>
    <dl>
     <dt><a href="manage.html"><img src="<?php echo C('WEB_URL');?>Public/business/images/deal_09.jpg" /></a></dt>
     <dd><a href="manage.html">会员管理</a></dd>
    </dl>
   </footer>
   
  </div><!--/navbar-->
 	<?php else: endif; ?>
</div><!--box-->
</body>
<script type="text/javascript" charset="UTF-8" src="<?php echo C('WEB_URL');?>Public/business/js/mui.min.js"></script>
<script type="text/javascript">
/*刷新和加载更多*/
mui.init({
	pullRefresh: {
		container: '#pullrefresh',
		down: {
			callback: pulldownRefresh
		},
		up: {
			contentrefresh: '正在加载...',
			callback: pullupRefresh
		}
	}
});
var count = 0;
/**
 * 下拉刷新具体业务实现
 */
function pulldownRefresh() {
	setTimeout(function() {
		var table = document.body.querySelector('.mui-table-view');
		var cells = document.body.querySelectorAll('.mui-table-view-cell');
		for (var i = cells.length, len = i + 10; i < len; i++) {
			var li = document.createElement('li');
			window.location.reload();
			//下拉刷新，新纪录插到最前面；
			table.insertBefore(li, table.firstChild);
		}
		mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
	}, 1500);
}
var count = 0;
/**
 * 上拉加载具体业务实现
 */
function pullupRefresh() {
	setTimeout(function() {
		mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
		var table = document.body.querySelector('.mui-table-view');
		var cells = document.body.querySelectorAll('.mui-table-view-cell');
		var nums=document.getElementById("contentop").children.length;
		$.ajax({
			  type:'POST',
			  url:'employeeRefresh_details',
			  dataType: "json",
			  data: 'limit='+nums,
			  success:function(data){
			
				$.each(data, function(index, item){
					console.log(item);
					var li = document.createElement('li');

					li.className = 'action';
					
					li.innerHTML = '<div class="detail"><p>'+item.time +'</p><div class="detLeft"><img src="<?php echo C('WEB_URL');?>Public/business/images/member_03.jpg" /></div><div class="detCenter"><p>NO.'+item.user_id+'</p><p class="detName">'+item.name+'</p><p>使用优惠卡</p></div><div class="detRight"><p>'+item.used_money+'</p></div></div>';
					
					table.appendChild(li);
                 
             });
			
			
			  	}
			 })
		
	}, 1500);
}
if (mui.os.plus) {
	mui.plusReady(function() {
		setTimeout(function() {
			mui('#pullrefresh').pullRefresh().pullupLoading();
		}, 1000);

	});
} else {
	mui.ready(function() {
		mui('#pullrefresh').pullRefresh().pullupLoading();
	});
}

		</script>
	</body>
	
	

</html>